package org.fuys.coder.domain.audit.service.policy.result.impl;

import org.fuys.coder.domain.audit.model.req.AuditTask;
import org.fuys.coder.domain.audit.model.res.AuditResult;
import org.fuys.coder.domain.audit.service.policy.result.AuditResultStrategy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @projectName: fuys-low-coder
 * @package: org.fuys.coder.domain.audit.service.policy.result.impl
 * @className: PassStrategy
 * @author: WangJing
 * @description: 机审通过的策略
 * @date: 2024/6/22 17:33
 * @version: 1.0
 */
@Service("passStrategy")
public class PassStrategy implements AuditResultStrategy {

    @Override
    @Async
    public void handleResult(AuditResult auditResult, AuditTask task) {
        //审核通过了之后 应该是各回各家 各找各妈了
        //确保审核进行完成了
        if(auditResult.isFinish()){
            //执行设置需要执行的回调
            task.getCallback().apply(null);
        }
    }
}
